﻿<Window x:Class="TranslatorService.WPFExample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Text-To-Speech WPF Example" ResizeMode="NoResize" Width="550" Height="450" 
        Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" Icon="/TranslatorService.WPFExample;component/Sound.ico">
    <Window.Resources>
        <Style TargetType="{x:Type Button}">
            <Setter Property="Padding" Value="15 5 15 5"></Setter>
        </Style>
    </Window.Resources>
    <Grid Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBlock Text="Text-To-Speech WPF Example" FontWeight="Bold" Grid.Row="0" FontSize="20" Margin="5"
                   Grid.ColumnSpan="2"></TextBlock>
        <StackPanel Grid.Row="1" Margin="5">
            <Label Content="_Text to speech:" Target="{Binding ElementName=txtText}"></Label>
            <TextBox x:Name="txtText" VerticalScrollBarVisibility="Visible" TextWrapping="Wrap" Height="100" Margin="5 0 0 0"></TextBox>
        </StackPanel>
        <StackPanel Grid.Row="2" Margin="5">
            <Label Content="T_ranslated text:" Target="{Binding ElementName=txtTranslatedText}"></Label>
            <TextBox x:Name="txtTranslatedText" VerticalScrollBarVisibility="Visible" TextWrapping="Wrap"
                     IsReadOnly="True" Height="100" Margin="5 0 0 0"></TextBox>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="1" Margin="5" Grid.RowSpan="2">
            <TextBlock Text="Options" FontWeight="Bold" Margin="0 0 0 10"></TextBlock>
            <CheckBox x:Name="chkAutoDetectLanguage" Content="_Auto detect language" IsChecked="True" Click="chkAutoDetectLanguage_Click"></CheckBox>
            <Label Content="_Language for text-to-speech:" Target="{Binding ElementName=cboLanguages}"
                   Margin="0 5 0 0"></Label>
            <ComboBox x:Name="cboLanguages" MaxWidth="200" Margin="0 0 5 0" IsEnabled="False"></ComboBox>
            <CheckBox Content="Tra_nslate text before text-to-speech" Margin="0 10 5 0" IsChecked="True"
                      x:Name="chkAutomaticTranslation" IsEnabled="False"></CheckBox>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="2" Margin="5" HorizontalAlignment="Right">
            <Button x:Name="btnSpeak" Content="_Speak" Click="btnSpeak_Click"></Button>
            <Button x:Name="btnTranslate" Content="Trans_late" Margin="20 0 0 0" Click="btnTranslate_Click"></Button>
            <Button x:Name="btnDetectLanguage" Content="_Detect language" Margin="20 0 5 0" Click="btnDetectLanguage_Click"></Button>
        </StackPanel>
        <TextBlock Grid.Row="4" Grid.ColumnSpan="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5 5 10 10">
            Realized by
            <Hyperlink NavigateUri="http://blogs.ugidotnet.org/marcom" 
                       RequestNavigate="Hyperlink_RequestNavigate"> 
            Marco Minerva</Hyperlink>
        </TextBlock>   
        <StatusBar Grid.Row="5" Grid.ColumnSpan="2" BorderThickness="0,1,0,0" BorderBrush="Black">
            <TextBlock x:Name="txtMessage" Text="Ready"></TextBlock>
        </StatusBar>
    </Grid>
</Window>
